package dao;

import mappings.Types;
import org.hibernate.SessionFactory;
import org.hibernate.classic.Session;
import utils.HibernateUtil;

import java.util.List;

public class TypesDao
{
    private static SessionFactory sessionFactory = HibernateUtil.getSessionFactory();

    public List<Types> getAllTypes()
    {
        Session session = sessionFactory.openSession();

        List<Types> types = session.createCriteria(Types.class)
            .list();

        session.close();

        return types;
    }
}
